const Router = require('koa-router');
const userController = require('../controller/user.controller');
const {
  validateUser,
  encryptPassword,
  validLogin,
} = require('../middlewares/users.middleware');

const userRouter = new Router({ prefix: '/users' });

userRouter.post('/reg', validateUser, encryptPassword, userController.create);

userRouter.post('/login', validLogin, encryptPassword, userController.login);

module.exports = userRouter;
